//
//  ViewForStoryBoard.swift
//  MichaelToy
//
//  Created by MichaelSun on 2017/11/3.
//  Copyright © 2017年 MichaelSun. All rights reserved.
// 自定义View可视化集成到storyboard


import UIKit
@IBDesignable
class ViewForStoryBoard: UIView {
    @IBInspectable var cornerRadius: CGFloat = 0.0 {
        didSet {
            layer.cornerRadius = cornerRadius
            layer.masksToBounds = cornerRadius > 0
        }
    }
    @IBInspectable var borderWidth: CGFloat = 0 {
        didSet {
            layer.borderWidth = borderWidth
        }
    }
    @IBInspectable var borderColor: UIColor? {
        didSet {
            layer.borderColor = borderColor?.cgColor
        }
    }

    /*
    // Only override draw() if you perform custom drawing.
    // An empty implementation adversely affects performance during animation.
    override func draw(_ rect: CGRect) {
        // Drawing code
    }
    */

}


//@IBDesignable
//extension UIView {
//    @IBInspectable var cornerRadius: CGFloat {
//        get {
//                return layer.cornerRadius
//            }
//        set {
//                layer.cornerRadius = newValue
//                layer.masksToBounds = newValue > 0
//            }
//    }
//}

